package com.unidt.www.module.expert.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.unidt.www.framework.mybatis.core.mapper.BaseMapperX;
import com.unidt.www.module.expert.domain.ExpertInvitationDo;
import org.apache.ibatis.annotations.Mapper;

import java.util.Date;
import java.util.List;

/**
 * @author scjia
 */
@Mapper
public interface ExpertInvitationMapper extends BaseMapperX<ExpertInvitationDo> {
    /**
     * 功能描述: 获取需要监控短信发送的列表
     * @author sk
     * @date 2022/12/21
     * @param
     * @return java.util.List<com.unidt.www.module.expert.domain.ExpertInvitationDo>
     */

   default List<ExpertInvitationDo> getMonitorList(){

       /**
        *   邀约状态已经开启 status=1
        *  名单确认状态 rosterStatus =0
        *  startTime> 当前时间
        */
       LambdaQueryWrapper<ExpertInvitationDo> lambdaQueryWrapper =
               new LambdaQueryWrapper<>();
       lambdaQueryWrapper.eq(ExpertInvitationDo::getRosterStatus,0);
       lambdaQueryWrapper.eq(ExpertInvitationDo::getStatus,1);
       lambdaQueryWrapper.gt(ExpertInvitationDo::getStartTime,new Date());
       lambdaQueryWrapper.eq(ExpertInvitationDo::getDeleted,false);
       return this.selectList(lambdaQueryWrapper);
   }
}
